package logic

import (
	"context"
	"yk/models/mysql"

	"yk/ykrpc/internal/svc"
	"yk/ykrpc/ykrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type YkDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewYkDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *YkDelLogic {
	return &YkDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *YkDelLogic) YkDel(in *ykrpc.YkDelRequest) (*ykrpc.YkDelResponse, error) {
	// todo: add your logic here and delete this line
	mysql.DB.Debug().Where("id =?", in.Id).Delete(&mysql.Phone{})
	return &ykrpc.YkDelResponse{}, nil
}
